Skip to content

fix(purge): re-published derived rows replace their derivation input edges (#9653) - #9655

Closed
Masashi-Ono0611 wants to merge 1 commit into
garrytan:masterfrom
Masashi-Ono0611:fix/issue-9653
Closed

Masashi-Ono0611 wants to merge 1 commit into
garrytan:masterfrom
Masashi-Ono0611:fix/issue-9653

Conversation

@Masashi-Ono0611

Copy link
Copy Markdown
Contributor

Related to #9653

When a deriver re-publishes a row, its derivation_inputs edge set is now replaced with the current inputs (including clearing it when the current input list is empty), so purging a former input no longer soft-deletes a row that no longer uses it.

Discrimination test

Discrimination test: reverted src/core/facts/derivation-inputs.ts, src/core/persistence/prepared-maintenance.ts, src/core/trust/taint.ts to 280b5a87cac6, ran bun test test/derivation-inputs-republish-9653.test.ts → fails without the fix. Restored → passes with the fix (T-0 recheck: proceed at master 280b5a8; pass/fail counts were not captured by the T-0 runner).

Reproduced on latest master 280b5a8 right before submission.

Verification

  • Not verified by this automated submission: any verify command or remediation text this PR adds was not run against a system in the broken state.

Tests

  • test/derivation-inputs-republish-9653.test.ts (added or changed by this PR)
  • bun test test/derivation-inputs-republish-9653.test.ts: fails without the fix, passes with it (T-0 recheck: proceed at master 280b5a8; pass/fail counts not captured)

…edges (garrytan#9653)

Related to garrytan#9653

Re-publication replaces the row's derivation_inputs edges with the current inputs, including when the current set is empty.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@trunk-io

trunk-io Bot commented Nov 17, 2026

Copy link
Copy Markdown

Merging to master in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

Copy link
Copy Markdown

Thanks for this pull request, @Masashi-Ono0611. Here is how we handle outside pull requests, so you know what to expect:

  • Documentation people read (not files agents load, such as SKILL.md or AGENTS.md) can be merged as it is, after we check every link, command and install step in it.
  • Small, plainly correct fixes (under about 40 lines not counting tests, such as an error message or a typo) are taken even when the gain is small. We rebuild them on current master and credit you as co-author: the commit says Contributed by @Masashi-Ono0611 and carries a Co-Authored-By: trailer with your name. We land at most one of these a day, so it can take a few days.
  • Everything else, including all other code and anything that runs, we read as a detailed bug report. When we take it, we rebuild it on current master with the same credit.

When we rebuild a change, we close this PR with a link to the PR that landed it. When we don't take one, we close it with a short note saying why and what would change our answer. So apart from documentation, "closed, not merged" is the normal outcome and doesn't mean your work was turned down.

For a larger change, show us:

  • a way to reproduce the problem on current master, or a failing test;
  • what goes wrong for someone using gbrain because of it;
  • the version you saw it on (gbrain version).

A limit of 3 open pull requests applies only to someone whose recent pull requests have mostly been closed without being taken. It never applies to anyone who has had a pull request taken (merged or rebuilt) in the last 90 days.

More in CONTRIBUTING.md, "How an outside pull request is handled": https://github.com/garrytan/gbrain/blob/master/CONTRIBUTING.md#how-an-outside-pull-request-is-handled

This comment comes from the fix-wave gate check. It is red on every outside pull request by design, and a maintainer clears it when merging a documentation change.

@capy-ai

capy-ai Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Thanks for this, @Masashi-Ono0611. It replaces a derived row's input edges when it is re-published, so purging a former input no longer soft-deletes a concept that stopped using it (#9653). That's fixed on the main branch: each concept publication now replaces its input record with the current members (v0.60.741.0), and a concept hidden that way is rebuilt on the next synthesis (#9794, v0.60.746.0). gbrain doctor's concept_stale_inputs check counts any left from older versions. So I'm closing this one; if it still happens on v0.60.746.0 or later, reply here with what you see.

@capy-ai capy-ai Bot closed this Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant